

<%@ page import="Biblioteca.Emprestimo" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <g:if test="${tipoUsuario == 'Admin'}">
        	<meta name="layout" content="adminBiblioteca" />
        </g:if>
        <g:else>
        	<meta name="layout" content="usuarioBiblioteca" />
        </g:else>
        <g:set var="entityName" value="${message(code: 'emprestimo.label', default: 'Emprestimo')}" />
        <title><g:message code="SPL - Editando Emprestimo" args="[entityName]" /></title>
    </head>
    <body>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${emprestimoInstance}">
            <div class="errors">
                <g:renderErrors bean="${emprestimoInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${emprestimoInstance?.id}" />
                <g:hiddenField name="version" value="${emprestimoInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        	<tr class="prop">
                                <td valign="top" class="name">
                                    <label for="itens"><g:message code="Selecione os itens que desejar" default="Selecione os itens que desejar" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: emprestimoInstance, field: 'itens', 'errors')}">
                                    <g:select id="itemSelection" name="itens" size="20" multiple="yes" default="Itens" from="${itens}"/>
                                </td>
                             </tr>
                        	<tr class="prop">
                                <td valign="top" class="name">
                                    <label for="login"><g:message code="emprestimo.login.label" default="Login do responsavel" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: emprestimoInstance, field: 'login', 'errors')}">
                                	<g:select id="loginsSelection" name="login" default="Login do Responsavel" from="${usuarios}"/>
                                </td>
                            </tr>
                              <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="diasEmail"><g:message code="emprestimo.diasEmail.label" default="Dias para enviar Email" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: emprestimoInstance, field: 'diasEmail', 'errors')}">
                                    <g:select id="diasEmailSelection" name="diasEmail" default="Dias para enviar Email" from="${10..30}" value="${emprestimoInstance?.diasEmail}"/>
                                </td>
                            </tr>
                                                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
